//
//  SEUserInfoStatusCell.swift
//  SmartEyeForDoctor
//
//  Created by qdsg on 2021/5/6.
//

import UIKit

protocol SEUserInfoStatusCellDelegate: NSObjectProtocol {
    func userInfoStatusCellBtnAction()
}

class SEUserInfoStatusCell: UITableViewCell {

    @IBOutlet weak var statusLabel: UILabel!
    @IBOutlet weak var confirmBtn: UIButton! {
        didSet {
            confirmBtn.layer.cornerRadius = confirmBtn.frame.size.height / 2.0
            confirmBtn.layer.borderColor = UIColor(hex: "#99DDC3").cgColor
            confirmBtn.layer.borderWidth = 1
            confirmBtn.layer.masksToBounds = true
        }
    }
    @IBAction func confirmBtnAction(_ sender: UIButton) {
        delegate?.userInfoStatusCellBtnAction()
    }

    weak var delegate: SEUserInfoStatusCellDelegate?

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    func updateData(_ viewModel: SEUserInfoViewModel) {
        statusLabel.text = viewModel.model.isAuthenticate.title
        confirmBtn.isHidden = viewModel.model.isAuthenticate.isHiddenConfirmBtn
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
